import React from 'react';

import {StackNavigator} from 'react-navigation';
import CardStackStyleInterpolator from "react-navigation/src/views/CardStack/CardStackStyleInterpolator";
import * as Color from "../lib.xjs/constant/Color";
import GaQuAppStartUp from '../gaqu/view/sys/BizAppStartUp';
import GaQuLogin from '../gaqu/view/sys/GaquLogin';
import RoleSelect from '../gaqu/view/sys/RoleSelect';
import CabinList from '../gaqu/view/sevice/CabinList';
import CabinOperateMain from "../gaqu/view/sevice/CabinOperateMain";
import CabinExerciseList from "../gaqu/view/sevice/CabinExerciseList";
import PersonExerciseList from "../gaqu/view/sevice/PersonExerciseList";
import PersonCharge from "../gaqu/view/sevice/PersonCharge";
import PersonMarkerManage from "../gaqu/view/sevice/PersonMarkerManage";
import RefoundList from "../gaqu/view/finance/RefoundList";
import CabinReportList from "../gaqu/view/statistics/CabinReportList";
import CabinReport from "../gaqu/view/statistics/CabinReport";
import CabinSupportStuff from "./view/sevice/CabinSupportStuff";

/** 嘎趣跑跑admin页面路由 */
let mStacks = {

    /** 默认显示 */
    'GaQuAppStartUp':{
        screen: GaQuAppStartUp,
        navigationOptions: {
            header: false, // 不显示导航栏
            headerTitle: '嘎趣跑跑'
        }
    },

    'CabinReport':{
        screen: CabinReport,
    },

    'CabinReportList':{
        screen: CabinReportList,
    },

    'RefoundList':{
        screen: RefoundList,
    },

    'PersonMarkerManage':{
        screen: PersonMarkerManage,
    },

    'PersonCharge':{
        screen: PersonCharge,
    },

    'PersonExerciseList':{
        screen: PersonExerciseList,
    },

    'CabinOperateMain':{
        screen: CabinOperateMain,
    },

    'CabinSupportStuff':{
        screen: CabinSupportStuff,
    },

    'CabinExerciseList':{
        screen: CabinExerciseList,
    },

    'CabinList':{
        screen: CabinList,
        navigationOptions: {
            headerTitle: '选择仓体'
        }
    },

    'RoleSelect':{
        screen: RoleSelect,
        navigationOptions: {
            header: false, // 不显示导航栏
            headerTitle: '选择角色'
        }
    },

    'GaQuLogin':{
        screen: GaQuLogin,
        navigationOptions: {
            headerTitle: '嘎趣跑跑'
        }
    },

};

/** 全项目所有路由页面 */
class StackManager {
    /** 真正首页列表的项 */
    static get() {
        return mStacks;
    }
}

/** [这里优先级底, 通用配置]全项目所有路由页面的跳转配置,也可在[路由项的navigationOptions]属性里单独配置,且优先级更高 */
const NavigationOptions = {
    // initialRouteName: 'Home',
    // initialRouteParams: {initPara: '初始页面参数'},
    navigationOptions: {
        gesturesEnabled: true,
        // headerTitle: '标题',
        headerTintColor:Color.white,    // 整个头部的颜色
        // headerTitleStyle: {fontSize: 18, color: Color.white},    // 头部的标题style
        headerStyle: {height: 48, backgroundColor: Color.colorPrimary},
    },
    // paths: 'page/main',
    // mode: 'card',
    headerMode: 'screen',
    // cardStyle: {backgroundColor: "#ffffff"},
    transitionConfig: (() => ({
        screenInterpolator: CardStackStyleInterpolator.forHorizontal,
    })),
    // onTransitionStart: (() => {
    //     console.log('页面跳转动画开始');
    // }),
    // onTransitionEnd: (() => {
    //     console.log('页面跳转动画结束');
    // }),
};

/** 这里的数据会在首页的功能列表上面显示（只是全部stack的一部分） */
export default StackNavigator(StackManager.get(), NavigationOptions);

